<!-- 高管列表 -->
<template>
  <div class="table w1021">
    <div class="tableTh tableTr flex">
      <span class="tableTd w175 high">序号</span>
      <span class="tableTd w175 left">姓名</span>
      <span class="tableTd w175 left">性别</span>
      <span class="tableTd w175 left">年龄</span>
      <span class="tableTd w175 left">学历</span>
      <span class="tableTd w175 left">职务</span>
      <span class="tableTd w175 left">任期起</span>
      <span class="tableTd w175 left">个人简历</span>
    </div>
    <div class="tableTh tableTr flex top" v-for="(item,index) in data" :key="index">
      <span class="orange tableTd w175 high">{{index+1}}</span>
      <span class="orange tableTd w175 high">{{item.indiName|filterVal}}</span>
      <span class="orange tableTd w175 high">{{item.gender|filterVal}}</span>
      <span class="orange tableTd w175 high">{{item.birthYear|filterVal("year")}}</span>
      <span class="orange tableTd w175 high">{{item.degree|filterVal}}</span>
      <span class="orange tableTd w175 high">{{item.post|filterVal}}</span>
      <span class="orange tableTd w175 high">{{item.startDate.substring(0,10)|filterVal}}</span>
      <span class="tableTd w175 cursor high" @click="detail(item)" v-if="item.resume">查看</span>
      <span class="orange tableTd w175 cursor high" v-else>--</span>
    </div>
    <div class="tableNone orange w1021 top" v-if="data.length==0">暂无数据</div>
  </div>
</template>

<script>

import {BASE_URL} from "@/common/const";

export default {
  data() {
    return {};
  },
  props: ["data"],
  filters: {
    filterVal(ops, num) {
      if (num == "year") {
        let date = new Date();
        let year = date.getFullYear();
        return ops ? year - ops : "不详";
      }
      return ops ? ops : "不详";
    }
  },
  methods: {
    detail(ops) {
      const url = `${BASE_URL}/client/mngInfoDetail/dev.html`;
      window.prompt(
        "",
        `up://["open.web",${Date.now()},{"url":"${url}?${Date.now()}&id=${
          ops.id
        }&code=${
          window._stockCode
        }","title":"公司高管--个人简历","popuptype":1}]`
      );
    }
  }
};
</script>
<style lang='scss' scoped>
</style>